home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 682 / rexxhostlib / rexxhostbase.h < prev    next >
C/C++ Source or Header  |  1995-03-18  |  5KB  |  162 lines

  1. /*
  2. **    rexxhost.library - ARexx host management support library
  3. **
  4. **    Copyright © 1990-1992 by Olaf `Olsen' Barthel
  5. **        All Rights Reserved
  6. */
  7.  
  8. #ifndef _REXXHOSTBASE_H
  9. #define _REXXHOSTBASE_H 1
  10.  
  11. #ifndef REXX_RXSLIB_H
  12. #include <rexx/rxslib.h>
  13. #endif    /* !REXX_RXSLIB_H */
  14.  
  15.     /* Main library structure (note: RexxSysBase can be reused
  16.      * by opening program).
  17.      */
  18.  
  19. struct RexxHostBase
  20. {
  21.     struct Library     LibNode;
  22.     struct RxsLib    *RexxSysBase;
  23.  
  24.     /* Everything below this point is considered PRIVATE and
  25.      * subject to change without notice (even though there isn't
  26.      * very much yet).
  27.      */
  28. };
  29.  
  30.     /* This is an extended MsgPort structure which includes
  31.      * a special ID CreateRexxHost/DeleteRexxHost/SendRexxCommand
  32.      * rely on.
  33.      */
  34.  
  35. struct RexxHost
  36. {
  37.     /* Exec link. */
  38.  
  39.     struct MsgPort    rh_Port;
  40.  
  41.     /* Never touch the tags below, hands off - this may change soon. */
  42.  
  43.     ULONG        rh_Private0;
  44.     ULONG        rh_Private1[4];
  45. };
  46.  
  47.     /* This macro can be used to turn the signal bit
  48.      * contained in a RexxHost into a Wait-mask.
  49.      * Note: Argument must be a pointer.
  50.      */
  51.  
  52. #define HOSTMASK(Host) (1L << ((struct RexxHost *)Host) -> rh_Port . mp_SigBit)
  53.  
  54.     /* The library name. */
  55.  
  56. #define REXXHOSTNAME    "rexxhost.library"
  57.  
  58.     /* Use this value rather than REXXHOSTVERSION to open
  59.      * rexxhost.library.
  60.      */
  61.  
  62. #define REXXHOSTMINIMUM    34L
  63.  
  64.     /* The compiler version differences require the
  65.      * following preprocessor 'orgy'.
  66.      */
  67.  
  68. #ifdef __NO_PROTOS
  69. #undef __NO_PROTOS
  70. #endif    /* __NO_PROTOS */
  71.  
  72. #ifdef AZTEC_C
  73.  
  74.     /* No version symbol? We'll redefine it. */
  75.  
  76. #ifndef __VERSION
  77. #define __VERSION 360
  78. #endif    /* __VERSION */
  79.  
  80.     /* Aztec 'C' 5.0 includes full prototype checking and
  81.      * pragma support.
  82.      */
  83.  
  84. #if __VERSION < 500
  85. #define __NO_PROTOS    1
  86. #define __NO_PRAGMAS    1
  87. #endif    /* __VERSION */
  88.  
  89. #endif    /* AZTEC_C */
  90.  
  91.     /* Now for the prototype handling. */
  92.  
  93. #ifdef __NO_PROTOS
  94. #define __ARGS(x) ()
  95. #else
  96. #define __ARGS(x) x
  97. #endif    /* __NO_PROTOS */
  98.  
  99.     /* Prototypes for library functions. */
  100.  
  101. struct RexxHost *    CreateRexxHost __ARGS((STRPTR));
  102. VOID *            DeleteRexxHost __ARGS((struct RexxHost *));
  103. LONG            SendRexxCommand __ARGS((struct RexxHost *,STRPTR,STRPTR,STRPTR));
  104. VOID            FreeRexxCommand __ARGS((struct RexxMsg *));
  105. VOID            ReplyRexxCommand __ARGS((struct RexxMsg *,LONG,LONG,STRPTR));
  106. STRPTR            GetRexxCommand __ARGS((struct RexxMsg *));
  107. STRPTR            GetRexxArg __ARGS((struct RexxMsg *));
  108. LONG            GetRexxResult1 __ARGS((struct RexxMsg *));
  109. LONG            GetRexxResult2 __ARGS((struct RexxMsg *));
  110. STRPTR            GetToken __ARGS((STRPTR,LONG *,STRPTR,LONG));
  111. LONG            GetStringValue __ARGS((STRPTR));
  112. STRPTR            BuildValueString __ARGS((LONG,STRPTR));
  113. LONG            RexxStrCmp __ARGS((UBYTE *,UBYTE *));
  114. struct RexxMsg *    GetRexxMsg __ARGS((struct RexxHost *,LONG));
  115. ULONG            SendRexxMsg __ARGS((STRPTR,STRPTR *,STRPTR,LONG));
  116. VOID            GetRexxString __ARGS((STRPTR,STRPTR));
  117. LONG            GetRexxClip __ARGS((char *Name,LONG WhichArg));
  118.  
  119.     /* The pragmas, both for Manx & Lattice. */
  120.  
  121. #ifndef __NO_PRAGMAS
  122. #ifdef AZTEC_C
  123. #pragma amicall(RexxHostBase, 0x1e, CreateRexxHost(a0))
  124. #pragma amicall(RexxHostBase, 0x24, DeleteRexxHost(a0))
  125. #pragma amicall(RexxHostBase, 0x2a, SendRexxCommand(a0,a1,a2,a3))
  126. #pragma amicall(RexxHostBase, 0x30, FreeRexxCommand(a0))
  127. #pragma amicall(RexxHostBase, 0x36, ReplyRexxCommand(a0,d0,d1,a1))
  128. #pragma amicall(RexxHostBase, 0x3c, GetRexxCommand(a0))
  129. #pragma amicall(RexxHostBase, 0x42, GetRexxArg(a0))
  130. #pragma amicall(RexxHostBase, 0x48, GetRexxResult1(a0))
  131. #pragma amicall(RexxHostBase, 0x4e, GetRexxResult2(a0))
  132. #pragma amicall(RexxHostBase, 0x54, GetToken(a0,a1,a2,d0))
  133. #pragma amicall(RexxHostBase, 0x5a, GetStringValue(a0))
  134. #pragma amicall(RexxHostBase, 0x60, BuildValueString(d0,a0))
  135. #pragma amicall(RexxHostBase, 0x66, RexxStrCmp(a0,a1))
  136. #pragma amicall(RexxHostBase, 0x6c, GetRexxMsg(a0,d0))
  137. #pragma amicall(RexxHostBase, 0x72, SendRexxMsg(a0,a1,a2,d0))
  138. #pragma amicall(RexxHostBase, 0x78, GetRexxString(d0,d1))
  139. #pragma amicall(RexxHostBase, 0x7e, GetRexxClip(a0,d0))
  140. #else    /* AZTEC_C */
  141. #pragma libcall RexxHostBase CreateRexxHost 1e 801
  142. #pragma libcall RexxHostBase DeleteRexxHost 24 801
  143. #pragma libcall RexxHostBase SendRexxCommand 2a ba9804
  144. #pragma libcall RexxHostBase FreeRexxCommand 30 801
  145. #pragma libcall RexxHostBase ReplyRexxCommand 36 910804
  146. #pragma libcall RexxHostBase GetRexxCommand 3c 801
  147. #pragma libcall RexxHostBase GetRexxArg 42 801
  148. #pragma libcall RexxHostBase GetRexxResult1 48 801
  149. #pragma libcall RexxHostBase GetRexxResult2 4e 801
  150. #pragma libcall RexxHostBase GetToken 54 a9804
  151. #pragma libcall RexxHostBase GetStringValue 5a 801
  152. #pragma libcall RexxHostBase BuildValueString 60 8002
  153. #pragma libcall RexxHostBase RexxStrCmp 66 9802
  154. #pragma libcall RexxHostBase GetRexxMsg 6c 802
  155. #pragma libcall RexxHostBase SendRexxMsg 72 a9804 
  156. #pragma libcall RexxHostBase GetRexxString 78 1002
  157. #pragma libcall RexxHostBase GetRexxClip 7e 802
  158. #endif    /* AZTEC_C */
  159. #endif    /* __NO_PRAGMAS */
  160.  
  161. #endif    /* _REXXHOSTBASE_H */
  162.